package vtt.android.tinthethao_ota.adapters;

import java.util.List;

import vtt.android.rsslib.BaseRssAdapter;
import vtt.android.rsslib.RssItem;
import vtt.android.tinthethao_ota.Constants;
import vtt.android.tinthethao_ota.R;
import android.content.Context;
import android.graphics.Bitmap;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;

public class RssAdapter extends BaseRssAdapter {
    
    private boolean isShowHeader;

    public RssAdapter(Context context, List<RssItem> items) {
        super(context, items);
    }

    @Override
    public DisplayImageOptions getDisplayImageOptions() {
        return new DisplayImageOptions.Builder()
            .showImageOnLoading(R.drawable.ic_adidas_brazuca)
            .showImageForEmptyUri(R.drawable.ic_adidas_brazuca)
            .showImageOnFail(R.drawable.ic_adidas_brazuca)
            .cacheInMemory(true)
            .cacheOnDisk(true)
            .bitmapConfig(Bitmap.Config.RGB_565)
            .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
            .build();
    }

    @Override
    public int getNumberPerPage() {
        return Constants.NUM_PER_PAGE;
    }

    @Override
    public boolean isShowHeader() {
        return isShowHeader;
    }

    public void setShowHeader(boolean showHeader) {
        this.isShowHeader = showHeader;
    }
}
